﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HeathCareSystem.wuc
{
    public partial class wucChuyenMuc : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // Kiem tra nhom nguoi dung
                if (Session["MaLoaiTaiKhoan"].ToString() == "LTK01")
                {
                    //pnlBacSi.Visible = true;
                    EnablePanel(true, false, false, false, false);
                }
                else if (Session["MaLoaiTaiKhoan"].ToString() == "LTK02")
                {
                    //pnlYTa.Visible = true;
                    EnablePanel(false, true, false, false, false);
                }
                else if (Session["MaLoaiTaiKhoan"].ToString() == "LTK03")
                {
                    //pnlTiepTan.Visible = true;
                    EnablePanel(false, false, true, false, false);
                }
                else if (Session["MaLoaiTaiKhoan"].ToString() == "LTK04")
                {
                    //pnlKhach.Visible = true;
                    EnablePanel(false, false, false, true, false);
                }
                else
                {
                    //pnlAdministrator.Visible = true;
                    EnablePanel(false, false, false, false, true);
                }
            }
            catch (System.Exception ex)
            {

            }

            
        }
        public void EnablePanel(bool bPanelBacSi, bool bPanelYTa, bool bPanelTiepTan, bool bPanelKhach, bool bPanelAdmin)
        {
            pnlAdministrator.Visible = bPanelAdmin;
            pnlBacSi.Visible = bPanelBacSi;
            pnlKhach.Visible = bPanelKhach;
            pnlYTa.Visible = bPanelYTa;
            pnlTiepTan.Visible = bPanelTiepTan;
        }

    }
}